﻿using DotNetty.Buffers;
using DotNetty.Codecs;
using DotNetty.Transport.Channels;
using PSAMMatrixCloud.Common;

namespace PSAMMatrixCloud.TransferSecret.LaneMutual
{
    internal class MessageEncoder : MessageToByteEncoder<Message>
    {
        protected override void Encode(IChannelHandlerContext context, Message message, IByteBuffer output)
        {
            byte[] data = message.ToBytes();
            LogHelper.Info("应答数据帧：" + Check.ByteArrayToHexString(data));
            output.WriteBytes(data);
        }
    }
}